home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlComboGetDroppedControlRect.au3 < prev    next >
Text File  |  2007-09-08  |  1KB  |  34 lines

  1. #include <GuiConstants.au3>
  2. #include <GuiCombo.au3>
  3.  
  4. opt('MustDeclareVars', 1)
  5.  
  6. Dim $Combo, $Btn_Exit, $msg, $label_rect, $s_rect, $Btn_GETRECT
  7.  
  8. GUICreate("ComboBox Get Dropped Control RECT", 392, 254)
  9.  
  10. $Combo = GUICtrlCreateCombo("", 70, 10, 270, 120)
  11. GUICtrlSetData($Combo, "AutoIt|v3|is|freeware|BASIC-like|scripting|language|designed|for|automating|the Windows GUI.")
  12.  
  13. $Btn_GETRECT = GUICtrlCreateButton("Get Dropped Control Rect", 150, 130, 90, 40, $BS_MULTILINE)
  14. $Btn_Exit = GUICtrlCreateButton("Exit", 150, 180, 90, 30)
  15.  
  16. $s_rect = "Left:" & @LF & "Top:" & @LF & "Right:" & @LF & "Bottom:"
  17. $label_rect = GUICtrlCreateLabel($s_rect, 145, 50, 100, 55, $SS_SUNKEN)
  18.  
  19. GUISetState()
  20. While 1
  21.    $msg = GUIGetMsg()
  22.    Select
  23.       Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
  24.          ExitLoop
  25.       Case $msg = $Btn_GETRECT
  26.          Local $rect_array = _GUICtrlComboGetDroppedControlRect($Combo)
  27.          If (IsArray($rect_array)) Then
  28.             $s_rect = "Left:" & $rect_array[1] & @LF & "Top:" & $rect_array[2] & @LF & "Right:" & $rect_array[3] & @LF & "Bottom:" & $rect_array[4]
  29.             GUICtrlSetData($label_rect, $s_rect)
  30.          EndIf
  31.    EndSelect
  32. WEnd
  33. Exit
  34.